import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { SectionRoomsWrapper } from './style'
import RoomItem from '../room-item'

const SectionRooms = memo(({rooms, width}) => {
  return (
    <SectionRoomsWrapper>
        {
            rooms?.slice(0, 8).map(room => {
                return <RoomItem key={room.id} room={room} width={width}/>
            })
        }
    </SectionRoomsWrapper>
  )
})

SectionRooms.propTypes = {
    rooms: PropTypes.array,
    width: PropTypes.string
}

export default SectionRooms